-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Files] Add download file test #2139
Conversation
Your Render PR Server URL is https://chainsafe-components-stage-pr-2139.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-ca36ufvh8vl0h151h8r0. |
Your Render PR Server URL is https://files-ui-stage-pr-2139.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-ca36ugvh8vl0h151h92g. |
Your Render PR Server URL is https://storage-ui-stage-pr-2139.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-ca36ui7h8vl0h151h9k0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess testing whether the downloaded file contents match what was uploaded is a bit out of scope? Might be an interesting addition to this test.
I didn't though about that, but seems a nice validation, apparently Cypress has a function readFile so I think I can add it in this PR, doesn't seem very complicated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely written test :) I can see why you used the const instead of a cypress alias. Makes sense for the path assertion.
Good use of the intercept and wait for reliability too 🚀
…e/ui-monorepo into mnt/add-download-file-test-2132
File validation added! @FSM1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Testing that the content matches is really reassuring !
downloadCompleteToast.body().should("be.visible") | ||
downloadCompleteToast.closeButton().click() | ||
cy.get<string>("@fileContent").then((fileContent) => { | ||
cy.readFile(path.join(downloadsFolder, fileName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since path
isn't a direct dependency of this project, I wouldn't use it here, just to make sure nothing breaks unexpectedly. It's also super simple in this case.
cy.readFile(path.join(downloadsFolder, fileName)) | |
cy.readFile(`${downloadsFolder}/${fileName}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test Juan! I've just been messing a bit with the code, trying to not bring in any unneeded dependency.
…e/ui-monorepo into mnt/add-download-file-test-2132
I didn't want to drag this branch too long so I pushed to it directly to:
|
closes #2132
Probably is a good idea to add this test case to Storage too, if this PR goes well, I will add that case after that.